package behavioralPattern.observer.example02;

import java.util.Date;

public class LotteryServiceImpl implements LotteryService{

    // 注入摇号服务
    private DrawHouseService houseService = new DrawHouseService();

    @Override
    public LotteryResult lottery(String uid) {
        // 摇号
        String result = houseService.lots(uid);

        // 发短信
        System.out.println("============发送短信通知用户：" + result);

        // 发mq信息
        System.out.println("id：" + uid + "；结果：" + result);


        return new LotteryResult(uid,result,new Date());
    }
}
